package cn.myeasyai.util;

import org.dromara.easyai.matrixTools.Matrix;

import java.util.ArrayList;
import java.util.List;

/**
 * @author fushoujiang
 */
public class MatrixUtil {
    //矩阵转LIST<Float>
    public static List<Float> matrixToFloatList(Matrix matrix) throws Exception {
        List<Float> list = new ArrayList<>();
        int x = matrix.getX();
        int y = matrix.getY();
        for (int i = 0; i < x; i++) {
            for (int j = 0; j < y; j++) {
                list.add((float)matrix.getNumber(i, j));
            }
        }
        return list;
    }
}
